package com.tang.sso.controller.domain;

import com.tang.sso.entity.TbDomain;
import com.tang.sso.service.DomainService;
import com.tang.sso.util.Result.Result;
import com.tang.sso.util.Result.ResultCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zjg
 * @date 2018/8/14 15:34
 * @Description 子系统(域名)管理控制层
 */
@Slf4j
@RestController
@RequestMapping("/domain")
public class DomainController {

    @Resource
    private DomainService domainService;

    /**
     * 查出所有域名信息
     *
     * @return
     */
    @GetMapping
    public Result<List<TbDomain>> getAllDomain() {
        List<TbDomain> domainList = domainService.selectAll();
        return new Result<>(ResultCodeEnum.SELECTSUCCESS, null, domainList);
    }

}
